Skip to content

feat: Canton to EVM swap examples (API + SDK)#39

Open
nickp96 wants to merge 1 commit into
mainfrom
feat/canton-swap-examples
Open

feat: Canton to EVM swap examples (API + SDK)#39
nickp96 wants to merge 1 commit into
mainfrom
feat/canton-swap-examples

Conversation

@nickp96

@nickp96 nickp96 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Canton → EVM swap examples for both the API and SDK, following the established patterns from other chain integrations (Stellar, XRPL, Hedera).

What's included

V2/api/cantonToEVMSwap/

  • Full working TypeScript example using the Squid REST API
  • Demonstrates the deposit-address flow: get route → extract deposit address + order hash memo → poll status
  • Canton Coin (CC) → USDC on Base swap

V2/sdk/cantonToEVMSwap/

  • Full working TypeScript example using the Squid SDK
  • Same deposit-address flow using squid.getRoute() and squid.getStatus()
  • Canton transactions are dispatched natively (not via executeRoute) since Canton is non-EVM

Canton-Specific Behavior

  • Route type: DEPOSIT_ADDRESS_DIRECT_TRANSFER — route returns a deposit address (target) and order hash (data)
  • Transfer memo: Order hash must be included as the transfer memo (splice.lfdecentralizedtrust.org/reason key)
  • Status tracking: Uses quoteId only — no transactionId (Canton status is tracked by quoteId alone)
  • Wallet signing: In browser environments, Canton wallets use CIP-103 + Splice token-standard TransferFactory

Related PRs

  • squid-react-hooks #820: Canton chainType scaffolding
  • squid-react-hooks #830: Canton wallet connection + balances
  • squid-widget #2485: Canton deposit/wallet flow
  • squid-ui #451: Canton UI updates
  • squid-documentation PR: Canton chain integration guide

@nickp96 nickp96 force-pushed the feat/canton-swap-examples branch 5 times, most recently from 0aaa6c6 to fcd757a Compare June 18, 2026 18:49
- API example: cantonToEVMSwap using deposit-address pattern
- SDK example: cantonToEVMSwap using Squid SDK with native dispatch
- Both demonstrate Canton Coin → USDC on Base swap
- Canton routes use DEPOSIT_ADDRESS_DIRECT_TRANSFER type
- Status tracked by quoteId only (no transactionId)
@nickp96 nickp96 force-pushed the feat/canton-swap-examples branch from fcd757a to 3101c2e Compare June 18, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant